<template>
  <div class="card-box">
    <template v-if="$slots.header">
      <div class="header">
        <slot name="header"></slot>
      </div>
    </template>

    <template v-if="$slots.search">
      <div class="search">
        <slot name="search"></slot>
      </div>
    </template>

    <div class="content">
      <el-scrollbar>
        <slot></slot>
      </el-scrollbar>
    </div>

    <template v-if="$slots.footer">
      <div class="footer">
        <slot name="footer"></slot>
      </div>
    </template>
  </div>
</template>

<script setup name="TreeBox"></script>

<style lang="scss" scoped>
.card-box {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--el-border-color);
  //border-bottom: 0;
  width: 300px;
  height: 100%;
  background-color: #ffffff;

  .header {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 35px;
    border-bottom: 1px solid var(--el-border-color);
    // background-image: linear-gradient(to top, #dfe9f3 0%, white 100%);
    background-color: #f5f7fa;
  }

  .search {
    display: flex;
    padding: 5px;
  }

  .content {
    display: flex;
    flex: 1;
    flex-direction: column;
    overflow-y: auto;

    .el-scrollbar {
      width: 100%;
    }
  }

  .footer {
    height: 40px;
    border-top: 1px solid var(--el-border-color);
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
</style>
